
def ShowPages(count,p):
    """
    count   总页数
    p       当前页数


    begin   开始页
    end     结束页
    """
    if count>=1 and count < 10:
        for x in range(1,count+1):
            print(x,end=',')
    elif count >= 10:
        if p <= 4 and p >=1:
            begin = 1
            a = 10
        elif p >1 and p <= count - 5:
            begin = p - 4
            a = p + 5
        elif p > count - 5:
            begin = count - 9
            a = count

        for x in range(begin,a+1):
            print(x,end=',')

# ShowPages(100,1)
# ShowPages(100,100)
# ShowPages(100,3)
# ShowPages(100,91)
ShowPages(6,5)


